from api import *

# this is the name that will be printed
# for this tool on the main menu
TOOL_NAME = "Traceroute"

# this controls what arguments will be presented to the
# end user, what name they'll be put under, and the
# type of input you're looking for
ARGUMENTS = [Argument(name='target', input_type='text')]
    

def run(target):
    route = scapy.traceroute(target)
    ips = []
    output = ''
    for pkt in route[0]:
        ips.append(pkt[1].src)
    for ip in ips:
        output += '<b>' + str(ip) + '</b></br>'
    return output
